from superdice.libs.diceConfigs import configFile
from superdice.superdice import registerRoll, unregisterRoll

def es_map_start(ev):
    cfgData.execute()

def unload():
    unregisterRoll(diceRoll)

def diceRoll(userid, player, eplayer):
    player.health += int(healthgain)

cfgData = configFile('dice_healthgain')
healthgain = cfgData.cvar('superdice_cfg_healthgain_health', 50, 'How much health does the player gain?')
cfgData.write()
cfgData.execute()

registerRoll(diceRoll, 'healthgain')
